package com.wang.pojo2;

import com.wang.pojo.Cat;
import com.wang.pojo.Dog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class People2 {
    @Autowired  //注释自动装配
    @Qualifier(value = "dog22")
    private Dog2 dog2;
    @Autowired  //注释自动装配
    @Qualifier(value = "cat22")//指定特定的
    private Cat2 cat2;
    private String name2;


    public Dog2 getDog2() {
        return dog2;
    }

//    public void setDog2(Dog2 dog2) {
//        this.dog2 = dog2;
//    }

    public Cat2 getCat2() {
        return cat2;
    }

//    public void setCat2(Cat2 cat2) {
//        this.cat2 = cat2;
//    }

    public String getName2() {
        return name2;
    }

    public void setName2(String name2) {
        this.name2 = name2;
    }


    @Override
    public String toString() {
        return "People2{" +
                "dog2=" + dog2 +
                ", cat2=" + cat2 +
                ", name2='" + name2 + '\'' +
                '}';
    }
}
